﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace devtm.AutoMapper
{

    public abstract partial class MapperBase : INotifyPropertyChanged
    {


        internal sealed partial class NamePropertyHandler
        {
            protected override void OnValueChanged(MapperBase element, string oldValue, string newValue)
            {
                base.OnValueChanged(element, oldValue, newValue);
                element.PropertyChange("Name");
            }
        }


        internal sealed partial class MapMethodNamePropertyHandler
        {
            protected override void OnValueChanged(MapperBase element, string oldValue, string newValue)
            {
                base.OnValueChanged(element, oldValue, newValue);
                element.PropertyChange("MapMethodName");
            }
        }


        internal sealed partial class CustomConstructorPropertyHandler
        {
            protected override void OnValueChanged(MapperBase element, bool oldValue, bool newValue)
            {
                base.OnValueChanged(element, oldValue, newValue);
                element.PropertyChange("CustomConstructor");
            }
        }


        internal sealed partial class ExecuteMethodAfterCastPropertyHandler
        {
            protected override void OnValueChanged(MapperBase element, bool oldValue, bool newValue)
            {
                base.OnValueChanged(element, oldValue, newValue);
                element.PropertyChange("ExecuteMethodAfterCast");
            }
        }


        internal sealed partial class ExecuteMethodBeforeCastPropertyHandler
        {
            protected override void OnValueChanged(MapperBase element, bool oldValue, bool newValue)
            {
                base.OnValueChanged(element, oldValue, newValue);
                element.PropertyChange("ExecuteMethodBeforeCast");
            }
        }


        internal sealed partial class KindPropertyHandler
        {
            protected override void OnValueChanged(MapperBase element, Kind oldValue, Kind newValue)
            {
                base.OnValueChanged(element, oldValue, newValue);
                element.PropertyChange("Kind");
            }
        }
        


        internal sealed partial class ReferenceMultiplePropertyHandler
        {
            protected override void OnValueChanged(MapperBase element, bool oldValue, bool newValue)
            {
                base.OnValueChanged(element, oldValue, newValue);
                element.PropertyChange("ReferenceMultiple");
            }
        }


        internal sealed partial class CustomConstructorMethodNamePropertyHandler
        {
            protected override void OnValueChanged(MapperBase element, string oldValue, string newValue)
            {
                base.OnValueChanged(element, oldValue, newValue);
                element.PropertyChange("CustomConstructorMethodName");
            }
        }


        internal sealed partial class TypeSourcePropertyHandler
        {
            protected override void OnValueChanged(MapperBase element, string oldValue, string newValue)
            {
                base.OnValueChanged(element, oldValue, newValue);
                element.PropertyChange("TypeSource");
            }
        }


        internal sealed partial class TypeDestinationPropertyHandler
        {
            protected override void OnValueChanged(MapperBase element, string oldValue, string newValue)
            {
                base.OnValueChanged(element, oldValue, newValue);
                element.PropertyChange("TypeDestination");
            }
        }


        internal sealed partial class IndexPropertyPropertyHandler
        {
            protected override void OnValueChanged(MapperBase element, string oldValue, string newValue)
            {
                base.OnValueChanged(element, oldValue, newValue);
                element.PropertyChange("IndexProperty");
            }
        }


        internal sealed partial class GeneratePropertyHandler
        {
            protected override void OnValueChanged(MapperBase element, bool oldValue, bool newValue)
            {
                base.OnValueChanged(element, oldValue, newValue);
                element.PropertyChange("Generate");
            }
        }


        protected void PropertyChange(string propertyName)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }

        public event PropertyChangedEventHandler PropertyChanged;
    }



}
